package mrunit;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.IOException;

/**
 * Created by zhaopan on 2017/6/28.<br>
 *
 * @Description:
 */
public class Index
{
    public static void main(String[]arg) throws IOException
    {
        Configuration hbaseConfiguration = HBaseConfiguration.create();
        HTable table = new HTable(hbaseConfiguration, "MC_2016");
        Put put = new Put(Bytes.toBytes("r4"));
        put.addColumn(Bytes.toBytes("0"), Bytes.toBytes("c1"), Bytes.toBytes("1"));
        put.addColumn(Bytes.toBytes("0"), Bytes.toBytes("c2"), Bytes.toBytes("2"));
        put.addColumn(Bytes.toBytes("0"), Bytes.toBytes("c3"), Bytes.toBytes("3"));
        put.addColumn(Bytes.toBytes("0"), Bytes.toBytes("c4"), Bytes.toBytes("4"));
        table.put(put);
        table.close();
    }
}
